//
//  S1mpl3TelevisionCollectionViewCell.m
//  沙哈拉FM
//
//  Created by dllo on 15/11/4.
//  Copyright © 2015年 S1mpl3. All rights reserved.
//

#import "S1mpl3TelevisionCollectionViewCell.h"
#import "UIImageView+WebCache.h"
#import "FitHeader.h"

@implementation S1mpl3TelevisionCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self =  [super initWithFrame:frame];
    if (self) {
        
        
        _imageView = [[UIImageView alloc]init];
        [self addSubview:_imageView];
        _imageView.backgroundColor = [UIColor greenColor];
        _label = [[BaseLabel alloc]init];
        //_label.backgroundColor = [UIColor blueColor];
        _label.font = [UIFont systemFontOfSize:15];
        _label.textAlignment = 1;
        _label.numberOfLines = 0;
        [self addSubview:_label];
        
        _coverLabel = [[BaseLabel alloc]init];
        _coverLabel.backgroundColor = [UIColor blackColor];
        _coverLabel.alpha = 0.5;
        _coverLabel.textColor = [UIColor whiteColor];
        //_label.backgroundColor = [UIColor blueColor];
        _coverLabel.font = [UIFont systemFontOfSize:14];
        [self addSubview:_coverLabel];
    }
    
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    
    
    _imageView.frame = CGRectMake(3 * FITWidth, 0, 119 * FITWidth, 130 * FITHeight);
    _coverLabel.frame = CGRectMake(_imageView.frame.origin.x, _imageView.frame.origin.y + 110 * FITHeight, _imageView.frame.size.width, 20 * FITHeight);
    _label.frame = CGRectMake(_imageView.frame.origin.x, _imageView.frame.origin.y + _imageView.frame.size.height, _imageView.frame.size.width, 50 * FITHeight);
    
    
}

-(void)setRecommend:(S1mpl3Recommend *)recommend{
    [_imageView sd_setImageWithURL:[NSURL URLWithString:recommend.coverLarge] placeholderImage:[UIImage imageNamed:@""]];
    _label.text = recommend.trackTitle;
    _coverLabel.text = recommend.title;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
